import {createRouter, createWebHistory} from 'vue-router'
import Login from "../views/Login";
import Admin from "../views/admin/Admin";
import Welcome from "../views/admin/Welcome";
import Article from "../views/admin/system/Article";
import File from "../views/admin/system/File";


const routes = [
    {
        path: '/',
        name: 'Login',
        component: Login
    },
    {
        path: '/login',
        component: Login
    },
    {
        path: '/admin',
        name: 'Admin',
        component: Admin,
        redirect: "/admin/welcome",
        children: [
            {
                name:"AdminWle",
                path: "welcome",
                component: Welcome,
            },
            {
                path: "article",
                component: Article,
            },
            {
                path: "file",
                component: File,
            },
            {
                path: "administrators",
                component: () => import("../views/admin/system/Administrators"),
            },
            {
                path: 'resetPassword',
                component: () => import("../views/admin/self/ResetPassword"),
            },
            {
                path: 'making',
                component: () => import("../views/Making"),
            },
        ]
    },

    {
        path: '/404',
        name: '404',
        component: () => import('../views/404')
    },
    {
        path: '/:pathMatch(.*)',
        redirect: '/404'
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes,
})

export default router
